import request from '@/utils/request'

export function getRoleList(params: any) {
  return request.get('/api/staff/roles/page', { params })
}

export function addRole(data: any) {
  return request.post('/api/staff/roles', data)
}

export function updateRole(data: any) {
  return request.put('/api/staff/roles', data)
}

export function deleteRole(id: any) {
  return request.delete(`/api/staff/roles/${id}`)
}

export function updateRoleStatus(id: number, status: number) {
  return request.put(`/api/staff/roles/status/${id}?status=${status}`)
}

export function getUsersByRole(roleId: number) {
  return request.get(`/api/staff/roles/${roleId}/users`)
} 